$(document).ready(function(){

  $("#AddComfirm").click(function(){
    
   //获值
   var code=$("#code").val();
   var name=$("#name").val();
   var remark=$("#remark").val();
   var account_class=$("#AccountClass").val();
   var state=$('input:radio:checked').val();
   
   if(code==''){
	   alert("编码不能为空！");
   }else{
	   //ajax提交数据
	  
	   $.ajax({  
	       url : "/AddComfirm",  
	       type : "POST",       
	       dataType:'json',
	       data : {"code":code,
	    	       "name":name,
	    	       "remark":remark,
	    	       "account_class":account_class,
	    	       "state":state,
	    	       "create_time":date()
	       },  
	       success : function(data) { 
	       },  
	       error : function() {   
	       }  
	   });  
   }
  });
  
 
    
  //获取时间
  function date(){
   var mydate = new Date();
   var str = "" + mydate.getFullYear() + "-";
   str += (mydate.getMonth()+1) + "-";
   str += mydate.getDate();
   return str;
  }
  
  
});